package com.echat.elocation.protocol.entity.receive;

import com.echat.elocation.protocol.entity.PackageMsg;

public class ServerCommonRespMsg extends PackageMsg {

    public static final byte SUCCESS = 0;
    public static final byte FAILURE = 1;
    public static final byte MSG_ERROR = 2;
    public static final byte UNSUPPORTED = 3;
    public static final byte WARNING_MSG_ACK = 4;

    // byte[0-1] 应答流水号 对应的终端消息的流水号
    private int replyFlowId;
    // byte[2-3] 应答ID 对应的终端消息的ID
    private int replyId;
    /**
     * 0：成功∕确认<br>
     * 1：失败<br>
     * 2：消息有误<br>
     * 3：不支持<br>
     * 4：报警处理确认<br>
     */
    private int replyCode;

    public ServerCommonRespMsg(PackageMsg msg) {
        this.msgHeader = msg.getMsgHeader();
        this.msgBody = msg.getMsgBody();
        this.checkCode = msg.getCheckCode();
    }

    public int getReplyFlowId() {
        return replyFlowId;
    }

    public void setReplyFlowId(int replyFlowId) {
        this.replyFlowId = replyFlowId;
    }

    public int getReplyId() {
        return replyId;
    }

    public void setReplyId(int replyId) {
        this.replyId = replyId;
    }

    public int getReplyCode() {
        return replyCode;
    }

    public void setReplyCode(int replyCode) {
        this.replyCode = replyCode;
    }

    @Override
    public String toString() {
        return "ServerCommonRespMsg{" +
                "replyFlowId=" + replyFlowId +
                ", replyId=" + replyId +
                ", replyCode=" + replyCode +
                '}';
    }
}
